const addressList = () => import('views/address/addressList') //地址列表
const addAddress = () => import('views/address/addAddress') //编辑地址
const goodsDetail = () => import('views/goodsDetail/goodsDetail') //商品详情
const externaDetail = () => import('views/externaDetail/externaDetail') //外部商品商品详情
const search = () => import('views/search/search') //搜索页面
const searchList = () => import('views/search/search-list') //搜索列表
const prodGroupList = () => import('views/search/prodGroup-list') //搜索列表
const invoice = () => import('views/invoice/invoice') //开具发票
const invoiceTitle = () => import('views/invoice/invoiceTitle') //添加\编辑发票抬头
const sumbitInvoice = () => import('views/invoice/sumbitInvoice') //确认开具发票
const invoiceDetail = () => import('views/invoice/invoiceDetail') //发票详情页
const submitOrder = () => import('views/submitOrder/submitOrder') //提交订单
const identity = () => import('views/identity/identity') //身份信息
const selfPoint = () => import('views/selfPoint/selfPoint') //自提点
const map = () => import('views/map/map') //地图
const mapSearch = () => import('views/map/mapSearch') //地图搜索
const mapPoint = () => import('views/map/mapPoint') //地图点
const supplierHome = () => import('views/supplierHome') //供应商首页
const contactList = () => import('views/contactList') //客服列表

import { isMobile } from 'utils/utils'

export default [
    {
        path: '/addressList',
        name: 'addressList',
        component: addressList,
        meta: {
            title: '地址列表',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要不缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '收货地址' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/addAddress',
        name: 'addAddress',
        component: addAddress,
        meta: {
            title: '编辑地址',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要不缓存
            showHeadBox: false //显示HeadBox组件
        }
    },
    {
        path: '/goodsDetail',
        name: 'goodsDetail',
        component: goodsDetail,
        meta: {
            title: '商品详情',
            showHeadBox: false, //显示HeadBox组件
            keepAlive: false, //添加该字段，表示需要缓存
            titleName: '商品详情', //HeadBox组件中间显示的文字
            isShare: true
        },
        beforeEnter: (to, from, next) => {
            if (!isMobile()) {
                to.meta.showHeadBox = false
            }
            next()
        }
    },
	{
	    path: '/externaDetail',
	    name: 'externaDetail',
	    component: externaDetail,
	    meta: {
	        title: '商品详情',
	        showHeadBox: false, //显示HeadBox组件
	        keepAlive: false, //添加该字段，表示需要缓存
	        titleName: '商品详情', //HeadBox组件中间显示的文字
	        isShare: true
	    },
	    beforeEnter: (to, from, next) => {
	        if (!isMobile()) {
	            to.meta.showHeadBox = false
	        }
	        next()
	    }
	},
    {
        path: '/search',
        component: search,
        meta: {
            title: '搜索',
            keepAlive: false
        }
    },
    {
        path: '/searchList',
		name: 'searchList',
        component: searchList,
        meta: {
            title: '搜索列表',
            keepAlive: true,
            type: 'search'
        }
    },
    {
        path: '/search/prodGroupList',
        component: prodGroupList,
        meta: {
            title: '商品分组',
            keepAlive: false
        }
    },

    {
        path: '/invoice',
        name: 'invoice',
        component: invoice,
        meta: {
            title: '开具发票',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要不缓存
            showHeadBox: true, //显示HeadBox组件
            titleName: '开具发票' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/invoiceTitle',
        name: 'invoiceTitle',
        component: invoiceTitle,
        meta: {
            title: '发票抬头',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要不缓存
            showHeadBox: true, //显示HeadBox组件
            titleName: '发票抬头' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/sumbitInvoice',
        name: 'sumbitInvoice',
        component: sumbitInvoice,
        meta: {
            title: '开具发票',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要不缓存
            showHeadBox: true, //显示HeadBox组件
            titleName: '开具发票' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/invoiceDetail',
        name: 'invoiceDetail',
        component: invoiceDetail,
        meta: {
            title: '发票详情',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要不缓存
            showHeadBox: true, //显示HeadBox组件
            titleName: '发票详情' //HeadBox组件中间显示的文字
        }
    },

    {
        path: '/submitOrder',
        name: 'submitOrder',
        component: submitOrder,
        meta: {
            title: '提交订单',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false //添加该字段，表示需要缓存
            // showHeadBox: true, //显示HeadBox组件
            // titleName: '提交订单', //HeadBox组件中间显示的文字
        }
    },

    {
        path: '/identity',
        name: 'identity',
        component: identity,
        meta: {
            title: '身份信息',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '身份信息' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/selfPoint',
        name: 'selfPoint',
        component: selfPoint,
        meta: {
            title: '自提点列表',
            requireAuth: false, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '自提点列表' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/map',
        name: 'map',
        component: map,
        meta: {
            title: '地图选点',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '地图选点' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/mapPoint',
        name: 'mapPoint',
        component: mapPoint,
        meta: {
            title: '查看地点',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '查看地点' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/mapSearch',
        name: 'mapSearch',
        component: mapSearch,
        meta: {
            title: '地图搜索',
            requireAuth: true, // 添加该字段，表示进入这个路由是需要登录的
            keepAlive: false, //添加该字段，表示需要缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '地图搜索' //HeadBox组件中间显示的文字
        }
    },
    {
        path: '/supplierHome',
        name: 'supplierHome',
        component: supplierHome,
        meta: {
            title: '供应商首页',
            requireAuth: false, 
            keepAlive: false, //添加该字段，表示需要缓存
            showHeadBox: false, //显示HeadBox组件
            titleName: '供应商首页' //HeadBox组件中间显示的文字
        }
    },
	{
	    path: '/contactList',
	    name: 'contactList',
	    component: contactList,
	    meta: {
	        title: '联系客服',
	        requireAuth: false, // 添加该字段，表示进入这个路由是需要登录的
	        keepAlive: false, //添加该字段，表示需要不缓存
	        showHeadBox: false, //显示HeadBox组件
	        titleName: '联系客服' //HeadBox组件中间显示的文字
	    }
	},
]
